#include "decode_thread.h"
#include <QPainter>
#include <QLabel>
#include <QPixmap>

DecodeThread::DecodeThread(QLabel *label, QPixmap *pixmap, int y) {
    this->label = label;
    this->pixmap = pixmap;
    this->y = y;
}

void DecodeThread::run() {
    QPainter painter(pixmap);
    int i=0;
    QString str;

    while(1)
    {
        //QString *str = new QString("RUN");
    str.sprintf("RUN: %d", i++);
    label->setText(str);
    i++;
    QThread::msleep(500);
    ((QWidget*)(label->parent()))->setWindowTitle("xxxxxxxxxxx");
#if 0
    for(int i = 10; i < 300; i += 10) {
    	painter.drawEllipse(i, y, 30, 30);
    	label->setPixmap(*pixmap);    	
        QThread::msleep(500); 
    }
#endif
    }
}
